package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import com.ticket.sass.common.entity.tenant.enums.OrderPayType;
import com.ticket.sass.common.entity.tenant.enums.OrderPayStatus;
import com.ticket.sass.common.entity.tenant.enums.OrderStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 朱其鹏
 * @date 2024/4/9 15:10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("order_mixeds")
public class OrderMixedEntity {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    private String orderNo;
    private String externalOrderNo;
    private BigDecimal originalPrice;
    private BigDecimal payPrice;
    private OrderStatus status;
    private OrderPayType payType;
    private OrderPayStatus payStatus;
    private LocalDateTime payTime;
    private Long userId;
    private Long cinemaId;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @TableLogic(value = "null", delval = "now()")
    @TableField(select = false)
    private LocalDateTime deletedAt;

    @TableField(exist = false)
    private OrderPayEntity orderPay;

    @TableField(exist = false)
    private List<OrderEntity> orderList;

    @TableField(exist = false)
    private OrderEntity order;

    @TableField(exist = false)
    private CinemaEntity cinema;
}